package com.ruoyi.common.enums;

/**
 * @param
 * @author
 * @description 错误代码
 * 1.错误码为0表示陈宫，其他都表示错误
 * 2.错误码长度为3位的是通用错误码，常规的如400、401、404、500
 * 3.错误码长度为5位的是系统自定义错误码；建议统一格式：ABBCC
 * A:错误级别，如1代表系统级别错误，4代表参数校验错误，5代表业务级别错误
 * B:项目或者模块名称对应的编码
 * C:具体的错误编号，可从01开始自增，如果不够用可以扩展为3位
 * @date 2018/1/5
 * @return
 */
public enum ResultStatusCode {
    OK("200", "OK"),
    BAD_REQUEST("400", "参数解析失败"),
    INVALID_TOKEN("401", "未识别的身份"),
    TOO_MANY_REQUESTS("429", "您请求太频繁了，请稍后再试！"),
    METHOD_NOT_ALLOWED("405", "不支持当前请求方法"),
    SYSTEM_ERR("500", "服务器运行异常"),
    TOO_MUCH_DATA_ERROR("2002", "批量新增数据过多"),
    UN_SELECTED_ORG("10100", "未识别的企业身份"),
    NOT_PERMISSION_ERROR("10101", "您没有权限访问"),
    KICK_OUT_ERROR("10102", "您已被系统踢出登录"),
    BE_REPLACED_ERROR("10103", "您的账号已在其他地方登录"),
    ERROR_USER_PWD("10001", "用户密码验证失败"),
    UPLOAD_ERROR("10002", "上传文件异常"),
    CAPTCHA_ERROR("10003", "验证码错误"),
    CAPTCHA_SMS_ERROR("10004", "短信验证码错误"),
    EXCEL_EXPORT_ERROR("10005", "导出excel失败！"),
    SERVICE_MAPPER_ERROR("10006", "Mapper类转换异常"),
    BUSINESS_ERROR("50000", "业务异常"),
    NOT_EXIST_USER_OR_ERROR_PWD("50101", "该用户不存在或密码错误"),
    LOGGED_IN("50102", "该用户已登录"),
    USER_FROZEN("50103", "该用户已被冻结"),
    INVALID_CAPTCHA("50105", "无效的验证码"),
    EXIST_SAME_ACCOUNT("50106", "该账号已存在"),

    EXCHANGE_FIRST_MSG_TYPE_ERROR("60001","一级业务类型错误"),

    EXCHANGE_MSG_TYPE_ERROR("60002","二级业务类型缺失"),

    GENERATE_APP_SECRET_ERROR("60003","秘钥生成失败"),

    EXCHANGE_SIGN_VERIFICATION_ERROR("60004","签名验证异常"),

    EXCHANGE_MESSAGE_PARSING_ERROR("60005","报文解析异常"),

    EXCHANGE_ADDRESS_SERVICE_ERROR("60006","调用地址接口异常"),

    MESSAGE_EXCHANGE_FAIL_ADDRESS_DISABLED("60007","民航地址被禁用"),

    MESSAGE_EXCHANGE_FAIL_SENDER_ERROR("60008","报文发送人地址代码错误"),

    MESSAGE_EXCHANGE_DEP_ADDRESS_ISNULL("60009","接收方地址错误"),
    EXCHANGE_SIGN_VERIFICATION_FAIL("60010","签名验证失败"),
    MESSAGE_EXCHANGE_RECEIPT_STATUS_SUCCESS("60011","成功"),
    MESSAGE_EXCHANGE_RECEIPT_STATUS_FAIL("60012","失败"),
    EXCHANGE_CLIENT_CONFIG_ERROR("60013","客户端配置异常"),
    MESSAGE_EXCHANGE_SENDER_ISNULL("60014","报文发送人地址为空"),

    MESSAGE_CLIENT_CONNECTION_ERROR("60015","接入地址端连接异常"),

    MESSAGE_EXCHANGE_ADDRESS_ERROR("60016","交换地址错误"),
    EXCHANGE_START_CONSUMER_ERROR("60017","启动消费者异常"),
    MESSAGE_DECRYPT_ERROR("60018","报文解密失败");
    private String code;

    private String msg;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    ResultStatusCode(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
